package uk.ac.aber.Blockmation.Tests;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFrame;

import uk.ac.aber.Blockmation.DrawingPad;


public class DrawingPadTest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {

		JFrame f = new JFrame("Pad Example");
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		
		DrawingPad pad = new DrawingPad(Color.yellow);
		
		f.getContentPane().add( pad, BorderLayout.CENTER );

        //BufferedImage image = ImageIO.read( 
        //		new File ("src/uk/ac/aber/Blockmation/Tests/1.bmp"));    
        // tests setting image to this new image
        //pad.setImage(image);
        
		//pad.drawSquare(new Point(0,0), Color.blue);
		//pad.drawLineOnActualImg(new Point(10,10), new Point(20, 20));
        // tests changing pen color 
        //pad.setColor(Color.blue);
        
        //sets different block size
        //pad.setBlockSize(new Dimension(80,80));
        
        // turns the grid on
        pad.showGrid(true);

        //pad.setCurrentTool(DrawingPad.RECT);
        
/*      
 * 		Testing the resizing procedure in getImage method  
 * 		File fout = new File("src/output.bmp");
        ImageIO.write( pad.getImage(), "bmp", fout);
*/        
        
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);

		

	}

}
